# coding: utf-8

from django.contrib import admin
from enbook.games.models import Domains, Games

class DomainsAdmin(admin.ModelAdmin):
    list_filter = ('disable_scenarios', )
    ordering = ('domain_name', )
    search_fields = ('domain_name', )
    fieldsets = (
        (None, {
            'fields': (('domain_name', 'city_name'),('country', 'region'),)
        }),
        (None, {
            'fields': ('disable_scenarios', )
        }),
        (u'Владелец', {
#            'classes': ('collapse',),
            'fields': (('owner_name', 'owner_id',),)
        }),
        (u'Статистика домена', {
            'fields': (('games_played', 'players', 'teams'),),
        }),

    )


class GamesAdmin(admin.ModelAdmin):
    date_hierarchy = 'game_date'
    list_filter = ('has_scenario', 'disable_scenario', 'domain', )
    ordering = ('domain', 'game_num', )
    search_fields = ('game_name', 'game_num', 'domain__domain_name')

admin.site.register(Domains, DomainsAdmin)
admin.site.register(Games, GamesAdmin)
